From 15e7453af8cbc7684f19e1feab73604eb3fb64e1 Mon Sep 17 00:00:00 2001 From: "djm@kirby.fc.hp.com" Date: Fri, 4 Nov 2005 10:40:29 -0600 Subject: [PATCH] Minor driver code changes/rearrangement to reduce ia64-specific patches Signed-off by: Dan Magenheimer --- .../ia64/xen/drivers/patches/console.c.patch | 10 --------- .../ia64/xen/drivers/patches/devmem.c.patch | 10 --------- .../ia64/xen/drivers/patches/gnttab.c.patch | 22 ------------------- .../ia64/xen/drivers/patches/privcmd.c.patch | 10 --------- linux-2.6-xen-sparse/arch/xen/kernel/devmem.c | 1 + .../drivers/xen/blkback/blkback.c | 4 ++++ .../drivers/xen/blkfront/blkfront.c | 4 ++++ .../drivers/xen/console/console.c | 3 +++ .../drivers/xen/privcmd/privcmd.c | 1 + .../include/asm-xen/asm-ia64/fixmap.h | 3 ++- .../include/asm-xen/asm-ia64/synch_bitops.h | 2 ++ 11 files changed, 17 insertions(+), 53 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/console.c.patch b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/console.c.patch index d9b30e633b..71d655d4fd 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/console.c.patch +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/console.c.patch @@ -1,15 +1,5 @@ --- xen/console/console.c 2005-11-02 14:13:07.000000000 +0100 +++ xen.patched/console/console.c 2005-11-02 14:21:20.000000000 +0100 -@@ -196,6 +196,9 @@ - void xen_console_init(void) - #endif - { -+ if (xen_init() < 0) -+ return __RETCODE; -+ - if (xen_start_info->flags & SIF_INITDOMAIN) { - if (xc_mode == XC_DEFAULT) - xc_mode = XC_SERIAL; @@ -768,9 +771,15 @@ #endif diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/devmem.c.patch b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/devmem.c.patch index ec6e9b3c83..924296442e 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/devmem.c.patch +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/devmem.c.patch @@ -1,13 +1,3 @@ diff -Naur xen/core/devmem.c xen.patched/core/devmem.c --- xen/core/devmem.c 2005-09-23 10:54:50.000000000 -0600 +++ xen.patched/core/devmem.c 2005-09-23 10:57:51.000000000 -0600 -@@ -93,6 +93,9 @@ - if (uncached_access(file)) - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); - -+#ifdef __ia64__ -+#define direct_remap_pfn_range(a,b,c,d,e,f) remap_pfn_range(a,b,c,d,e) -+#endif - if (direct_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff, - vma->vm_end - vma->vm_start, - vma->vm_page_prot, DOMID_IO)) diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch index 84d89e1825..90272db1f4 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/gnttab.c.patch @@ -1,17 +1,6 @@ diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c --- xen/core/gnttab.c 2005-09-23 10:54:50.000000000 -0600 +++ xen.patched/core/gnttab.c 2005-09-23 10:57:51.000000000 -0600 -@@ -19,6 +19,10 @@ - #include - #include - -+#ifdef __ia64__ -+#define synch_cmpxchg ia64_cmpxchg4_acq -+#endif -+ - #if 1 - #define ASSERT(_p) \ - if ( !(_p) ) { printk(KERN_ALERT"Assertion '%s': line %d, file %s\n", \ @@ -346,6 +350,10 @@ if ( hypercall.op != __HYPERVISOR_grant_table_op ) return -ENOSYS; @@ -43,17 +32,6 @@ diff -Naur xen/core/gnttab.c xen.patched/core/gnttab.c set_fixmap(FIX_GNTTAB_END - i, frames[i] << PAGE_SHIFT); +#endif - return 0; - } -@@ -434,8 +448,10 @@ - { - int i; - -+#ifndef __ia64__ - for (i = 0; i < NR_GRANT_FRAMES; i++) - clear_fixmap(FIX_GNTTAB_END - i); -+#endif - return 0; } @@ -450,7 +466,9 @@ diff --git a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/privcmd.c.patch b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/privcmd.c.patch index cce9fec2fc..347ffa792d 100644 --- a/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/privcmd.c.patch +++ b/linux-2.6-xen-sparse/arch/ia64/xen/drivers/patches/privcmd.c.patch @@ -1,16 +1,6 @@ diff -Naur xen/privcmd/privcmd.c xen.patched/privcmd/privcmd.c --- xen/privcmd/privcmd.c 2005-09-23 10:54:50.000000000 -0600 +++ xen.patched/privcmd/privcmd.c 2005-09-23 10:57:51.000000000 -0600 -@@ -134,6 +134,9 @@ - > vma->vm_end ) - return -EINVAL; - -+#ifdef __ia64__ -+#define direct_remap_pfn_range(a,b,c,d,e,f) remap_pfn_range(a,b,c,d,e) -+#endif - if ((rc = direct_remap_pfn_range( - vma, - msg[j].va&PAGE_MASK, @@ -180,6 +183,15 @@ for (i = 0; i < m.num; i++, addr += PAGE_SIZE, p++) { if (get_user(mfn, p)) diff --git a/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c b/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c index 13b8320ccf..215804538c 100644 --- a/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c +++ b/linux-2.6-xen-sparse/arch/xen/kernel/devmem.c @@ -26,6 +26,7 @@ #include #include #include +#include static inline int uncached_access(struct file *file) { diff --git a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c index c9d812695e..3f9e90cfa8 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c @@ -13,6 +13,7 @@ #include #include +#include #include "common.h" /* @@ -494,6 +495,9 @@ static int __init blkif_init(void) int i; struct page *page; + if (xen_init() < 0) + return -ENODEV; + blkif_interface_init(); page = balloon_alloc_empty_page_range(MMAP_PAGES); diff --git a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c index 671f16038c..00f3674f73 100644 --- a/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c @@ -49,6 +49,7 @@ #include #include #include +#include #define BLKIF_STATE_DISCONNECTED 0 #define BLKIF_STATE_CONNECTED 1 @@ -727,6 +728,9 @@ static struct xenbus_driver blkfront = { static int __init xlblk_init(void) { + if (xen_init() < 0) + return -ENODEV; + xenbus_register_driver(&blkfront); return 0; } diff --git a/linux-2.6-xen-sparse/drivers/xen/console/console.c b/linux-2.6-xen-sparse/drivers/xen/console/console.c index 1a23f4495e..6da5d9159c 100644 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c @@ -196,6 +196,9 @@ static int __init xen_console_init(void) void xen_console_init(void) #endif { + if (xen_init() < 0) + return __RETCODE; + if (xen_start_info->flags & SIF_INITDOMAIN) { if (xc_mode == XC_DEFAULT) xc_mode = XC_SERIAL; diff --git a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c index db954ca768..8a9e295651 100644 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/fixmap.h b/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/fixmap.h index 40a8c178f1..4b32a82980 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/fixmap.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/fixmap.h @@ -1 +1,2 @@ -/* empty */ +#define clear_fixmap(x) do {} while (0) +#define set_fixmap(x,y) do {} while (0) diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h b/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h index 9ad2d1f390..ee1330659c 100644 --- a/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h +++ b/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h @@ -51,6 +51,8 @@ static __inline__ int synch_var_test_bit(int nr, volatile void * addr) return test_bit(nr, addr); } +#define synch_cmpxchg ia64_cmpxchg4_acq + #define synch_test_bit(nr,addr) \ (__builtin_constant_p(nr) ? \ synch_const_test_bit((nr),(addr)) : \ -- 2.30.2